package com.yizhang.pattern.chain;

/**
 * @Author: yi.zhang
 * @CreateTime: 2025-08-22 15:47:22
 * @Description:
 */
public class AuthHandler extends Handler<Member> {
    @Override
    public void handle(Member member) {
        if (!member.getRoleName().equals("admin")) {
            System.out.println("您不是管理员，无权访问");
            return;
        }
        System.out.println("欢迎您：" + member.getLoginName());
        if (null != this.next) {
            this.next.handle(member);
        }
    }
}
